package service;

import dao.LoginDao;
import entity.User;

import java.sql.SQLException;

public class UserService {
    private final LoginDao loginDao = new LoginDao();
    public User login(String username,String password){
        if (username == null || password ==null){
            return null;
        }
        try {
            return  loginDao.selectByUsernameAndPassword(username, password);
        } catch (SQLException e) {
            e.printStackTrace();
            return null;
        }
    }
}
